package Demo6;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int flag = 0;
        int x = 0;   //成功的次方
        int s = 0;   //1 +到 几

        for (int i = 0; i <= 10; i++) {
            int sum = 0;
            for (int j = 1; j <=100; j++) {
                sum+= (Math.pow(j,i));
                if (n == sum){
                    x = i;
                    flag = 1;
                    s = j;
                }
            }
        }

        if (flag == 0){
            System.out.println("Impossible for "+n+".");
        }else {
            for (int i = 1; i <= s; i++) {
                System.out.print(i+"^"+x);
                if (i != s){
                    System.out.print("+");
                }
            }
        }
    }
}
